<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="/webwork" prefix="ww"%>
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
  <title>Warehouse Status Interface</title>
 </head>
 <body>
 
 <%@ include file="/admin-header.html"%>
 
 <h2>Warehouse Status</h2>
 
 <ww:if test="hasActionErrors()">
   <ul>
    <ww:iterator value="actionErrors">
     <li>
      <ww:property/>
     </li>
    </ww:iterator>
   </ul>
  </ww:if><table border="1">
   <tr>
    <th>Order ID</th>
    <th>Customer Full Name</th>
    <th width="200">Time of Order</th>
    <th>Shipping Option</th>
    <th>Current OrderStatus</th>
    <th>Select New Status</th>
    <th>Order Details</th>
   </tr>
   
   <ww:iterator value="incompleteOrders">
    <tr>
     <td align="right">
      <ww:property value="id"/>
     </td>
     <td>
      <ww:property value="firstName"/>
      &nbsp;
      <ww:property value="lastName"/>
     </td>
     <td>
      <ww:property value="timeStamp"/>
     </td>
     <td>
      <ww:property value="shippingOption.companyName"/>
      &nbsp; -
      <ww:property value="shippingOption.serviceName"/>
     </td>
     <td>
      <ww:property value="orderStatus.step"/>
      &nbsp; - &nbsp;
      <ww:property value="orderStatus.name"/>
     </td>
     <td>
     <form name="updateStatusForm" action="WarehouseStepUpdate.action">
     <ww:hidden name="updateOrderId" value="%{id}"/>
      <%--
      <ww:select
        name="newStatusId"
        list="validOrderStatuses"
        value="%{valid.toString()}"
        required="true"
        />
     --%>
     
     <select name="newStatusId" size="1" style="width: 150px;">
     <ww:iterator value="validOrderStatuses" >
     <ww:if test="id == orderStatus.id">
        <option value="<ww:property value="id"/>" selected="selected" >
        <ww:property value="step"/> - <ww:property value="name"/></option>
      </ww:if>
      <ww:else>
        <option value="<ww:property value="id"/>">
        <ww:property value="step"/> - <ww:property value="name"/></option>
      </ww:else>

     </ww:iterator>
     </select>
     
     <input type="submit" value="Update Status">
     
     
     <%-- WEBWORK version of select box
     <form name="updateStatusForm" action="ShippingStepUpdate">
     <ww:select label="'OrderStatus'"
          name="selectedItem"
          list="validOrderStatuses"
          listKey="id"
          listValue="name"
          required="true" />     
     <input type="submit" name="">
     
     --%>
      </form>
     </td>
     <td>
      <ww:a href="GetOrderDetails.action?orderId=%{id}">View Order Details</ww:a>
     </td>
    </tr>
   </ww:iterator>
  </table>
  
  </body>
</html>